all: kml.jar

parser.jar: $(wildcard parser/src/*/*.java) parser/Manifest.txt
	@mkdir -p parser/bin
	javac -target 1.5 -source 1.5 parser/src/main/Parser.java -d parser/bin -classpath parser/src
	jar cfm parser.jar parser/Manifest.txt -C parser/bin .
	chmod +x parser.jar

kml.jar: $(wildcard kml-tool/src/*/*.java) kml-tool/Manifest.txt
	@mkdir -p kml-tool/bin
	chmod +x kml-tool/lib/commons-cli-1.2/*.jar
	javac -target 1.5 -source 1.5 kml-tool/src/main/Main.java -d kml-tool/bin -classpath "kml-tool/src:kml-tool/lib/commons-cli-1.2/commons-cli-1.2.jar"
	jar cfm kml.jar kml-tool/Manifest.txt -C kml-tool/bin .
	chmod +x kml.jar

clean:
	rm -rf parser.jar parser/bin kml-tool/bin

